﻿<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="12" MadCap:lastHeight="1913" MadCap:lastWidth="632">
    <head>
    </head>
    <body>
        <h1>Visual Studio 2012 Template Creation</h1>
        <h3>TODO:</h3>
        <ul>
            <li>find out how to get VS Templates to recognise and substitute $solutionname$</li>
            <li>find out how to add $(MxPluginSDKRoot) as a variable to Visual Studio</li>
            <li>combine PluginICPsample, PluginICPsampleApp and PluginICPsampleTest into a multiple template project </li>
        </ul>
        <h3>&#160;</h3>
        <h3>Instructions</h3>
        <p>In order to facilitate the creation of MxPlugins we have created a number of Visual Studio Project templates. These are created as follows:</p>
        <ol>
            <li>Use Windows Explorer to copy the folder \Projects\Codeplex\MxPlugin\PluginICPsample into a folder that isn't in source control, for example \Projects\Sandbox\x</li>
            <li>Use Visual Studio to set the project settings for PluginICPsample, PluginICPsampleApp and PluginICPsampleTest<ol><li><p>Set All Configurations</p><ol><li><p>C/C++, General - Additional Include Directories</p><ul><li><p>replace existing folder with $(MxPluginSDKRoot)PublicInterfaces </p></li></ul><ul><li><p>replace name of the MxPlugin project with $solutionname$; </p></li></ul></li></ol></li><li><p>Set Debug and Release Configurations</p><ol><li><p> Linker, General - Additional Library Directories - replace folder containing the root of the MxPlugin SDK with $(MxPluginSDKRoot)</p></li><li><p>Linker, Input - Additional Dependencies - ( PluginICPsampleApp and PluginICPsampleTest only) replace the name of the .lib for the MxPlugin your application is exercising with $solutionname$.lib </p></li></ol></li></ol></li>
            <li>Copy icon files for template and preview into the project folder (*.ico)</li>
            <li>Use Visual Studio to export the template (File | Export Template)<ol><li>Select Project Template and the Project you want to export, press Next</li><li>Set the name - i.e. MxPlugin</li><li>Set the icon files for template and preview</li><li>Do NOT check import template into Visual Studio</li><li>Press Finish to create the ZIP&#160;file</li></ol></li>
            <li>Use Windows Explorer to open the ZIP&#160;and copy the .vstemplate file back into the Project folder. Rename it as MxPlugin.vstemplate (or MxPluginApp, MxPluginTest)</li>
            <li>Use Notepad to edit the following files in the Project folder<ol><li><p>ReadMe.txt - add TODO&#160;instructions for person using the template</p></li><li>MxPlugin.vstemplate<ol><li><p>&lt;Name&gt;MxPluginApp&lt;/Name&gt;</p></li><li><p>&lt;Description&gt;Console App to exercise MxPlugin&lt;/Description&gt;</p></li><li><p>&lt;DefaultName&gt;PluginApp&lt;/DefaultName&gt;</p></li><li>set TargetFileName="$projectname$.vcxproj" for any files that you want to name the same as project name (as specified by person using the template)</li><li><p>set ProjectItem ReplaceParameters="true" for any files that you want to replace content with $projectname$ ( see *.cpp, *.h, *.rc below)</p></li></ol></li><li><p>*.vcxproj</p><ol><li>Remove source control bindings - add solution and projects to source control afterwards<ul><li><p>&lt;SccProjectName&gt;SAK&lt;/SccProjectName&gt;</p></li><li><p>&lt;SccAuxPath&gt;SAK&lt;/SccAuxPath&gt;</p></li><li><p>&lt;SccLocalPath&gt;SAK&lt;/SccLocalPath&gt;</p></li><li><p>&lt;SccProvider&gt;SAK&lt;/SccProvider&gt;</p></li></ul></li><li><p>Replace the folder for MxPlugin root in both &lt;AdditionalIncludeDirectories&gt; with $(MxPluginSDKRoot)</p></li><li>Replace the folder for MxPlugin root in both &lt;AdditionalLibraryDirectories&gt; with $(MxPluginSDKRoot)</li><li>Replace all occurences of PluginICPsample with $projectname$</li><li>Make sure all files are present. For example, ReadMe.txt in <ul><li><p>&lt;ItemGroup&gt;</p></li><li><p>&lt;Text Include="ReadMe.txt" /&gt;</p></li><li><p>&lt;/ItemGroup&gt;</p></li></ul></li></ol></li><li><p>*.cpp, *.h, *.rc</p><ul><li>Replace all occurences of PluginICPsample (or PluginICPsampleApp,  PluginICPsampleTest) with $projectname$</li></ul></li><li>*.vcxproj.filters<ul><li>Replace all occurences of PluginICPsample (or PluginICPsampleApp,  PluginICPsampleTest) with $projectname$</li><li>Make sure all files are present. For example, ReadMe.txt in <ul><li><p>&lt;ItemGroup&gt;</p></li><li><p>&lt;Text Include="ReadMe.txt" /&gt;</p></li><li><p>&lt;/ItemGroup&gt;</p></li></ul></li></ul></li></ol></li>
            <li>
                <p>Use Windows Explorer to delete PluginICPsampleTest.vcxproj.vspscc, Debug folder, Release folder</p>
            </li>
            <li>Use Windows Explorer to select all files, right-click | Send To - Compressed ZIP&#160;folder</li>
            <li>Use Windows Explorer to move ZIP&#160;folder to <ul><li>Visual Studio 2012\Templates\ProjectTemplates\Visual C++ Project</li></ul></li>
            <li>Use Windows Explorer to copy \Projects\Sandbox\x\PluginICPsample\PluginICPsample to<ul><li>Projects\Codeplex\MxPlugin\Templates\MxPlugins</li></ul></li>
            <li>Use Visual Studio Source Control Explorer to add folder copied in above step to source control</li>
        </ol>
    </body>
</html>